﻿using System.Web.Mvc;
using fmtx.Utility;

namespace website.Areas.Website
{
    public class WebsiteAreaRegistration : AreaRegistrationOrder
    {
        public override string AreaName
        {
            get
            {
                return "Website";
            }
        }

        public override void RegisterAreaOrder(AreaRegistrationContext context)
        {

            context.MapRoute(
               "img_Index",
               "Img/Temp/{m}_{w}_{h}",
               new { controller = "Img", action = "Temp", m = UrlParameter.Optional, w = UrlParameter.Optional, h = UrlParameter.Optional }
           );

            context.MapRoute(
                "Article_Index",
                "Article",
                new { controller = "Article", action = "Index", id = UrlParameter.Optional }
            );

            context.MapRoute(
                "Article_detail",
                "Article/{id}",
                new { controller = "Article", action = "Detail", id = UrlParameter.Optional }
            );

            context.MapRoute(
                "Photo_default",
                "Photo",
                new { controller = "Photo", action = "Index", id = UrlParameter.Optional }
            );

            context.MapRoute(
                "Photo_detail",
                "Photo/{id}",
                new { controller = "Photo", action = "Detail", id = UrlParameter.Optional }
            );

            context.MapRoute(
                "Area_detail",
                "Area/{id}",
                new { controller = "Area", action = "Index", id = UrlParameter.Optional },
                new { id = @"[\d]" }
            );

            context.MapRoute(
                "Country_detail",
                "Country/{id}",
                new { controller = "Country", action = "Index", id = UrlParameter.Optional },
                new { id = @"[\d]{1,30}" }
            );
            context.MapRoute(
                "Countryp_detail",
                "Country/{id}/p{p}",
                new { controller = "Country", action = "Index", id = UrlParameter.Optional, p = UrlParameter.Optional },
                new { id = @"[\d]{1,30}" }
            );
            context.MapRoute(
                "city_detail",
                "city/{id}",
                new { controller = "City", action = "Index", id = UrlParameter.Optional },
                new { id = @"[\d]{1,30}" }
            );
            context.MapRoute(
                "cityp_detail",
                "city/{id}/p{p}",
                new { controller = "City", action = "Index", id = UrlParameter.Optional, p = UrlParameter.Optional },
                new { id = @"[\d]{1,30}" }
            );

            context.MapRoute(
               "place_detail",
               "place/{id}",
               new { controller = "Place", action = "Index", id = UrlParameter.Optional },
               new { id = @"[\d]{1,30}" }
           );
            context.MapRoute(
                "placep_detail",
                "place/{id}/p{p}",
                new { controller = "Place", action = "Index", id = UrlParameter.Optional, p = UrlParameter.Optional },
                new { id = @"[\d]{1,30}" }
            );


            context.MapRoute(
                "Website_default",
                "{controller}/{action}/{id}",
                new { controller = "Home", action = "Index", id = UrlParameter.Optional }
            );
        }

        public override int Order
        {
            get { return 9999; }
        }
    }
}
